class FormsController < ApplicationController

	before_filter :check_logged , :check_form

	def new
		@form = Form.new

		respond_to do |format|
		  format.html # new.html.erb
		end
	end

	def create
		@form = Form.new(params[:form])
		@form.attendee_id = Attendee.find_by_user_login( current_user.login ).id

		respond_to do |format|
		  if @form.save
			flash[:notice] = 'Ok'
			format.html { redirect_to(attendees_path) }
		  else
			format.html { render :action => "new" }
		  end
		end
	end

end
